
bool is_bit_set( int x, int nbit)
{
    int m  = ( 1 << nbit );
    
    if( ( m & x ) != 0 )
        return true;
    else
        return false;
}

bool is_bit_set2( int x, int nbit)
{
    return ( x & (1 << nbit) );
}

int main()
{
    is_bit_set( 0x12FF4, 2 );

    is_bit_set2( 0x12ff4, 0 );

    return 0;
}
